Finding an endpoint when the midpoint is given